package com.bw.seckill_module.seckilllist;

import android.widget.ImageView;

import com.bw.imgload_sdk.LoadImgUtils;
import com.bw.seckill_module.R;
import com.bw.seckill_module.entity.GoodsEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class SecKillAdapter extends BaseQuickAdapter<GoodsEntity, BaseViewHolder> {

    public SecKillAdapter() {
        super(R.layout.item_seckill);
        addChildClickViewIds(R.id.seckill_add_tv);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, GoodsEntity goodsEntity) {
        ImageView seckill_item_img = baseViewHolder.getView(R.id.seckill_item_img);
        baseViewHolder.setText(R.id.seckill_item_title,goodsEntity.goods_desc);
        baseViewHolder.setText(R.id.seckill_item_dec,goodsEntity.goods_default_sku);
        baseViewHolder.setText(R.id.seckill_item_price,goodsEntity.goods_default_price);
        LoadImgUtils.loadMatchImg(goodsEntity.goods_default_icon,seckill_item_img);
    }
}
